
<%@ page import="com.moke.product.Product" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'product.label', default: 'Product')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-product" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div id="nav">
			<div style="float:left;">
				<h1>产品信息</h1>
			</div>
			<div class="nav" role="navigation" style="float:right;padding-right:50px;">
				<ul>
					<li><g:link class="create" action="create">查询</g:link></li>
					<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
				</ul>
				
			</div>
			
			<div style="clear:both;"></div>
			<div>
				<g:if test="${flash.message}">
				<div class="message" role="status">${flash.message}</div>
				</g:if>
			</div>
			<div class="module collapsed">
				<div><h3 class="toggle-title">查询条件</h3></div>
				<div>
					<g:form action="list">
						<div class="splitcontentleft">
							<label>产品编码</label><input size="30">
						</div>
						<div class="splitcontentright">
							<label>名称</label><input size="30">
						</div>
					</g:form>
				</div>
				<div style="clear:both;"></div>
			</div>
		</div>

		<div id="list-product" class="content scaffold-list" role="main">
			
			
			<table>
				<thead>
					<tr>
					
						<g:sortableColumn property="productCode" title="${message(code: 'product.productCode.label', default: 'Product Code')}" />
					
						<g:sortableColumn property="productName" title="${message(code: 'product.productName.label', default: 'Product Name')}" />
					
						<g:sortableColumn property="productSpec" title="${message(code: 'product.productSpec.label', default: 'Product Spec')}" />
					
						<g:sortableColumn property="price" title="${message(code: 'product.price.label', default: 'Price')}" />
					
						<g:sortableColumn property="stockNum" title="${message(code: 'product.stockNum.label', default: 'Stock Num')}" />
					
						<g:sortableColumn property="unit" title="${message(code: 'product.unit.label', default: 'Unit')}" />
					
						<th><g:message code="operate.label" default="operate" /></th>
					</tr>
				</thead>
				<tbody>
				<g:each in="${productInstanceList}" status="i" var="productInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${productInstance.id}">${fieldValue(bean: productInstance, field: "productCode")}</g:link></td>
					
						<td>${fieldValue(bean: productInstance, field: "productName")}</td>
					
						<td>${fieldValue(bean: productInstance, field: "productSpec")}</td>
					
						<td>${fieldValue(bean: productInstance, field: "price")}</td>
					
						<td>${fieldValue(bean: productInstance, field: "stockNum")}</td>
					
						<td>${fieldValue(bean: productInstance, field: "unit")}</td>
					
						<td><g:link class="edit" action="edit" id="${productInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
							<g:link class="edit" action="delete" id="${productInstance?.id}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');">
							<g:message code="default.button.delete.label" default="Delete" /></g:link>
							
						</td>
					</tr>
				</g:each>
				</tbody>
			</table>
			<g:if test="${productInstanceTotal > 0}">
				<div class="pagination">
					<g:paginate total="${productInstanceTotal}" />
				</div>
			</g:if>
			
		</div>
		<script type="text/javascript">
			$(document).ready(function(event){
				$(".module").groupContent();
			});

		</script>
	</body>
</html>
